<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" type="text/css" href="css/style.css"/>
    <link rel="stylesheet" type="text/css" href="css/WdatePicker.css"/>
    <link rel="stylesheet" type="text/css" href="css/skin_/table.css"/>
    <link rel="stylesheet" type="text/css" href="css/jquery.grid.css"/>
    <link rel="stylesheet" type="text/css" href="../layui-v2.3.0/layui/css/layui.css"/>

    <title></title>
</head>

<body>
<div id = "container">
    <div id="hd"></div>
    <div id="bd">
        <div id="main">
            <fieldset class="layui-elem-field layui-field-title">
                <legend>课题基本信息</legend>
                <table class="layui-table">
                    <input type="text" name="idtext" style="display: none"/>
                <tr>
                    <td>课程名称</td>
                    <td><input style="border: 0px;outline:none;cursor: pointer;" type='text' name="nametext" readonly/></td>
                </tr>
                <tr>
                    <td>课题上传时间</td>
                    <td><input style="border: 0px;outline:none;cursor: pointer;" type='text' name="timetext" readonly/></td>
                </tr>
                <tr>
                    <td>指导老师</td>
                    <td><input style="border: 0px;outline:none;cursor: pointer;" type='text' name="authtext" readonly/></td>
                </tr>
                </table>
            </fieldset>
                <fieldset class="layui-elem-field layui-field-title">
                    <legend>任务书详情</legend><br>
                    <blockquote class="layui-elem-quote layui-quote-nm">毕业论文（设计）任务与要求</blockquote>
                    <textarea name="taskbook" style="height: 300px;font-size:14px; font-style:  italic" class="layui-textarea" readonly></textarea><br>
                </fieldset>
            </div>
        </div>
    </div>
</div>

</body>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/global.js"></script>
<script type="text/javascript" src="js/jquery.select.js"></script>
<script type="text/javascript" src="js/core.js"></script>
<script type="text/javascript" src="js/jquery.pagination.js"></script>
<script type="text/javascript" src="js/jquery.grid.js"></script>
<script type="text/javascript" src="js/WdatePicker.js"></script>
<script type="text/javascript" src="../js/jquery.cookie.js"></script>
<script type="text/javascript" src="../js/application.js"></script>
<script type="text/javascript" src="../js/vue.js"></script>
<script type="text/javascript" src="../layui-v2.3.0/layui/layui.js"></script>
<script type="text/javascript">
    $.ajax({
        url: "/getArticleByChoose",
        type: "POST",
        data: {"token": getCookie("token")},
        success: function (res) {
            console.log(res);
            if(res=='[]'){
                $('input[name="idtext"]').val('');
                $('input[name="nametext"]').val('未选题');
                $('input[name="timetext"]').val('未选题');
                $('input[name="authtext"]').val('未选题');
            }else{
                var art = JSON.parse(res);
                var id = art[0].uuid;
                var articlename = art[0].articlename;
                var articlecreatetime = art[0].articlecreatetime;
                var articleauth = art[0].articleauth;
                $('input[name="idtext"]').val(id);
                $('input[name="nametext"]').val(articlename);
                $('input[name="timetext"]').val(articlecreatetime);
                $('input[name="authtext"]').val(articleauth);
            }
        },
        error: function (res) {
            layui.use('layer', function () {
                var layer = layui.layer;
                layer.msg('获取数据失败，请重试!!!', {
                    icon: 2
                });
            });
        }
    });
    var jon={};
    jon['token'] = getCookie('token');
    $.ajax({
        url: "/getTaskBook",
        type: "POST",
        data: {"jon": JSON.stringify(jon)},
        success: function (res) {
            debugger;
            if(res==""){
                $('textarea[name="taskbook"]').val("暂无任务书信息，请联系指导老师!!!");
            }else{
                $('textarea[name="taskbook"]').val(res);
            }
        },
        err: function () {

        }
    })

</script>
</html>
